package me.innolux.daxin_nesting.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Slf4j
public class AgvTaskSubmitVo {

    //消息码 "SUCCESS"
    private String code;

    //消息内容 "成功"
    private String message;


    private TaskSubmitData data;


    public static AgvTaskSubmitVo OK(Object taskCode){
        AgvTaskSubmitVo agvTaskSubmitVo = new AgvTaskSubmitVo();
        agvTaskSubmitVo.setCode("SUCCESS");
        agvTaskSubmitVo.setMessage("成功");
        TaskSubmitData taskSubmitData = new TaskSubmitData();
        taskSubmitData.setRobotTaskCode((String) taskCode);
        agvTaskSubmitVo.setData(taskSubmitData);
        log.info("返回成功:{}",agvTaskSubmitVo);
        return agvTaskSubmitVo;
    }

    public static AgvTaskSubmitVo ng(Object taskCode){
        AgvTaskSubmitVo agvTaskSubmitVo = new AgvTaskSubmitVo();
        agvTaskSubmitVo.setCode("fail");
        agvTaskSubmitVo.setMessage("失败");
        TaskSubmitData taskSubmitData = new TaskSubmitData();
        taskSubmitData.setRobotTaskCode((String) taskCode);
        agvTaskSubmitVo.setData(taskSubmitData);
        return agvTaskSubmitVo;
    }
}
